package com.rs.game.player.dialogues.impl;

import com.rs.Settings;
import com.rs.cache.loaders.NPCDefinitions;
import com.rs.game.player.content.FadingScreen;
import com.rs.game.player.controlers.StartTutorial;
import com.rs.game.player.dialogues.Dialogue;

public class QuestGuide extends Dialogue {

	int npcId;
	private StartTutorial controler;

	@Override
	public void finish() {
	}

	@Override
	public void run(int interfaceId, int componentId) {
		if (stage == -1) {
			sendNPCDialogue(npcId,9827,"Before we continue your journey, please make sure you visit our forums and read the rules. Become a true Styxian, become a legend! #DDF.");
			stage = 1;
		} else if (stage == 1) {
		    FadingScreen.fade(player, new Runnable() {
				@Override
				public void run() {
					if (controler != null)
						controler.setTutorialStage(1);
				}
			    });
			end();
		}
	}

	@Override
	public void start() {
		npcId = (Integer) parameters[0];
		controler = (StartTutorial) parameters[1];
		player.getInterfaceManager().removeInterface(372);
		sendEntityDialogue(SEND_2_TEXT_CHAT,new String[] {NPCDefinitions.getNPCDefinitions(npcId).name,"Ah.. yes.. yes.., I figured you would come. "
				+ "My friend, welcome to " + Settings.SERVER_NAME + "!" }, IS_NPC,npcId, 9827);
	}

}
